<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
    <script>
        function  area(w,h ) {
            area1=w*h;
            alert("长方形的面积为"+area1);
   }
        var  w=prompt("请输入长方形的宽：");
        var  h=prompt("请输入长方形的高：");
        area(w,h)
 
    </script>
    
</body>
</html>